<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div>
	<form id="f_team_user" action="<c:url value='/team/user/save.do'/>" method="post">
		<input type="hidden" name="teamUser.tuid" value="${teamUser.tuid}">
		<input type="hidden" name="teamUser.userid" value="${teamUser.userid}">
		<input type="hidden" name="teamUser.teamid" value="${teamUser.teamid}">
		<table>
		<tr>
			<th>昵称：</th>
			<td>
				<input name="teamUser.nickname" value="${teamUser.nickname}">
				(社区：<ms:user userid="${teamUser.userid}" type="gnickname"></ms:user>)
			</td>
		</tr>
		<tr>
			<th>加入时间：</th>
			<td>
				<fmt:formatDate value="${teamUser.createTime}" pattern="yyyy-MM-dd"/>
			</td>
		</tr>
		<tr>
			<th>职位：(组长只能有一个，副组长五个)</th>
			<td>
			<c:if test="${creator.position == 1}">
				<c:choose>
					<c:when test="${teamUser.position == 1}">
						<select name="teamUser.position">
							<option value="1" selected="selected">组长</option>
						</select>
					</c:when>
					<c:otherwise>
						<select name="teamUser.position">
							<option value="2" <c:if test="${teamUser.position == 2}">selected</c:if>>副组长</option>
							<option value="3" <c:if test="${teamUser.position == 3}">selected</c:if>>组员</option>
						</select>
					</c:otherwise>
				</c:choose>
			</c:if>
			<c:if test="${creator.position == 2 && creator.status == 1}">
				<select name="teamUser.position">
					<option value="3" selected="selected">组员</option>
				</select>
			</c:if>
			</td>
		</tr>
		<tr>
			<th>状态：</th>
			<td>
			<c:if test="${creator.position == 1}">
				<c:choose>
					<c:when test="${teamUser.position == 1}">
						<select name="teamUser.status">
							<option value="1" selected="selected">正常</option>
						</select>
					</c:when>
					<c:otherwise>
						<select name="teamUser.status">
							<option value="1" <c:if test="${teamUser.status == 1}">selected</c:if>>正常</option>
							<option value="2" <c:if test="${teamUser.status == 2}">selected</c:if>>申请</option>
							<option value="3" <c:if test="${teamUser.status == 3}">selected</c:if>>拒绝</option>
							<option value="4" <c:if test="${teamUser.status == 4}">selected</c:if>>邀请</option>
							<option value="9" <c:if test="${teamUser.status == 9}">selected</c:if>>屏蔽</option>
						</select>
					</c:otherwise>
				</c:choose>
			</c:if>
			<c:if test="${creator.position == 2 && creator.status == 1}">
				<select name="teamUser.status">
					<option value="1" <c:if test="${teamUser.status == 1}">selected</c:if>>正常</option>
					<option value="2" <c:if test="${teamUser.status == 2}">selected</c:if>>申请</option>
					<option value="3" <c:if test="${teamUser.status == 3}">selected</c:if>>拒绝</option>
					<option value="4" <c:if test="${teamUser.status == 4}">selected</c:if>>邀请</option>
					<option value="9" <c:if test="${teamUser.status == 9}">selected</c:if>>屏蔽</option>
				</select>
			</c:if>
			</td>
		</tr>
		<tr>
			<th>申请原因：</th>
			<td>
				<c:out value="${teamUser.applyPaper}"/>
			</td>
		</tr>
		</table>
		<input type="submit" value="保存">
	</form>
</div>